﻿@model IEnumerable<MvcShopping.Models.OrderHeader>
@{Layout = null;}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Thirteen Shop</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />

    <link rel="stylesheet" href="~/tpl/static/css/bootstrap.min.css" type="text/css" media="all" />
    <link rel="stylesheet" href="~/tpl/static/css/jquery-ui.min.css" type="text/css" media="all" />
    <link rel="stylesheet" href="~/tpl/Admin/common/css/admin.css" type="text/css" />
    <link href="~/Content/alert.css" rel="stylesheet" />

    <style>
        #Url {
            display: none;
        }

        .black {
            color: black;
        }
    </style>
    <script type="text/javascript" src="~/tpl/static/js/jquery-1.9.1.min.js"></script>
    <script src="~/Scripts/alert.js"></script>
    <script type="text/javascript" src="~/tpl/static/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="~/tpl/static/js/jquery.artDialog.js?skin=aero"></script>
    <script type="text/javascript" src="~/tpl/static/js/iframeTools.js"></script>
    <script type="text/javascript" src="~/tpl/static/js/jquery.form.min.js"></script>
    <script type="text/javascript" src="~/tpl/static/js/jquery.validate.min.js"></script>
    <script language="javascript" src="~/tpl/static/js/jquery.imagePreview.js"></script>
    <script type="text/javascript" src="~/tpl/static/js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="~/tpl/static/js/datepicker.js"></script>
    <script type="text/javascript" src="~/tpl/Admin/common/js/common.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>

</head>

<body>
    <!--顶部-->
    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="~/Home/index">Thirteen Shop后台管理</a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="~/Home/index" target="_blank"><i class="glyphicon glyphicon-home"></i> 网站首页</a>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="glyphicon glyphicon-user"></i> 超级管理员【admin】 <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            
                            <li>
                                <a href="~/Home/index">退出</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container-fluid -->
    </nav>
    <!--顶部结束-->
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <div id="nav">
                    <p id="p_home"><i class="glyphicon glyphicon-home"></i> 首页</p>
                    <p id="p_article"><i class="glyphicon glyphicon-list-alt"></i> 商品管理</p>
                    <div class="menu_body" id="b_article">
                        <li>
                            <a href="~/Admin/Add"><i class="glyphicon glyphicon-menu-right"></i> 添加商品</a>
                        </li>
                        <li>
                            <a href="~/Admin/Index"><i class="glyphicon glyphicon-menu-right"></i> 商品列表</a>
                        </li>
                    </div>

                    <p id="p_user"><i class="glyphicon glyphicon-user"></i> 用户管理</p>
                    <div class="menu_body" id="b_user">
                        <li>
                            <a href="~/AdminMember/Add"><i class="glyphicon glyphicon-menu-right"></i> 添加用户</a>
                        </li>
                        <li>
                            <a href="~/AdminMember/index"><i class="glyphicon glyphicon-menu-right"></i> 用户列表</a>
                        </li>
                        <li>
                            <a href="~/AdminRegister/addMember"><i class="glyphicon glyphicon-menu-right"></i> 新增管理员</a>
                        </li>
                    </div>
                    <p id="p_sys"><i class="glyphicon glyphicon-cog"></i> 订单管理</p>
                    <div class="menu_body" id="b_sys">
                        <li>
                            <a href="~/Admin/AdminOrder">查看订单</a>
                        </li>

                    </div>
                    <p id="p_sys"><i class="glyphicon glyphicon-adjust"></i> 类别管理</p>
                    <div class="menu_body" id="b_sys">
                        <li>

                            <a href="~/ProductCategories/Create">查看与添加</a>
                        </li>

                    </div>
                    <p id="p_sys"><i class="glyphicon glyphicon-cog"></i> 日志管理</p>
                    <div class="menu_body" id="b_sys">
                        <li>
                            <a href="~/Logs/Index">查看日志</a>
                        </li>

                    </div>
                </div>
            </div>

            <div class="col-md-10">

                <script type="text/javascript">
                    $(document).ready(function () {
                        $(".preview").preview();
                    });

                    function jumpUrl() {
                        v = document.getElementById("path").options[document.getElementById("path").selectedIndex].value;
                        url = "/index.php?g=admin&m=article&a=index&path=" + v;
                        window.location.href = url;
                    }
                </script>

                <ol class="breadcrumb">
                    <li>
                        <a href="javascript:;">订单管理</a>
                    </li>
                    <li class="active">查看订单</li>
                </ol>
                <table class="table table-hover">
                    <tr>
                        <th>
                            @Html.DisplayNameFor(model => model.Id)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.member)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.ContactName)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.ContractPhoneNo)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.ContactAddress)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.TotalPrice)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Memo)
                        </th>


                    </tr>

                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @Html.DisplayFor(modelItem => item.Id)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.member.Name)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.ContactName)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.ContractPhoneNo)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.ContactAddress)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.TotalPrice)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Memo)
                            </td>
                            <td>
                                @Html.ActionLink("商品清单", "AdminDetails", new { id = item.Id })
                            </td>
                        </tr>
                    }

                </table>

                <script type="text/javascript">
                                $("#path").val("");
                </script>

                <input type="hidden" id="menu_action" value="article" />
            </div>
        </div>

    </div>

    <script type="text/javascript">
                                var M = {

                                }


                                $(".deleteGood").click(function () {

                                    var getid = parseInt($(this).attr('data-id'));
                                    var content = "<div><p>商品“" + $(".black")[$(this).index() - 1].innerText
                                        + "”信息</p><p>商品名称：" + $('.black')[$(this).index() - 1].innerText
                                        + "</p><p>商品简介:"
                                        + $('.testTd1')[$(this).index() - 1].innerText + "</p><p>颜色：" +
                                        $('.testTd2')[$(this).index() - 1].innerText + "</p><p>价格："
                                        + $('.testTd3')[$(this).index() - 1].innerText + "</p><p>发行时间："
                                        + $('.testTd4')[$(this).index() - 1].innerText+"</p></div>";
                                    if (M.dialog7) {
                                        return M.dialog7.show();
                                    }
                                    M.dialog7 = jqueryAlert({

                                        'style': 'pc',
                                        'title': '确认删除吗？',
                                        'content': content,
                                        'modal': true,
                                        'contentTextAlign': 'left',
                                        'width': '500',
                                        'height': '400',
                                        'animateType': 'linear',
                                        'buttons': {
                                            '确定': function () {

                                                $.ajax({
                                                    url: 'changeToAsp',
                                                    data: { id: getid },
                                                    success: function () {
                                                        $("this").parents('.tra').remove();
                                                        M.dialog7.close();
                                                        if (M.dialog51) {
                                                            return M.dialog51.show();
                                                        }
                                                        M.dialog51 = jqueryAlert({
                                                            'content': '删除成功'
                                                        })
                                                    },
                                                    error: function () {
                                                        alert("服务器连接异常");
                                                        M.dialog7.close();
                                                    }
                                                });

                                            },
                                            '取消': function () {
                                                M.dialog7.close();
                                                if (M.dialog51) {
                                                    return M.dialog51.show();
                                                }
                                                M.dialog51 = jqueryAlert({
                                                    'content': '删除失败'
                                                })
                                            }
                                        }
                                    });
                                    //$.ajax({
                                    //    url: "changeToAsp",
                                    //    data: { Content: getid},
                                    //    cache: false,
                                    //    type: 'post',
                                    //    datatype;"json",
                                    //    success: function (data) {
                                    //       // alert(data);

                                    //    },
                                    //    error: function (data) {
                                    //        alert("服务器连接异常");
                                    //    }
                                    //});
                                });
              $(document).ready(function () {


                //幻灯片元素与类“menu_body”段与类“menu_head”时点击
                var menu_action = $("#menu_action").val();
                $("#p_" + menu_action).addClass("select");
                $("#b_" + menu_action).show().addClass("local");

                $("#nav p").click(function () {
                    $(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
                    $("#nav p").removeClass("select");
                    $(this).addClass("select");
                    $(this).next("div.menu_body").addClass("local");
                });

                $("#picname_src").click(function () {
                    $("#picname").click();
                    $("#Url").val($("#picname").val());
                })
            });
    </script>

</body>

</html>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

